#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QString>
#include <QDir>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private slots:
    void on_selectDirectoryButton_clicked();
    void on_convertButton_clicked();

private:
    Ui::MainWindow *ui;
    QString selectedDirectory;

    bool convertFile(const QString &filePath);
    bool isGBK(const QByteArray &data);
    void convertDirectory(const QString &dirPath);
};

#endif // MAINWINDOW_H